<?php
abstract class PaymentData extends Payment{

	protected	$_name;
	protected	$_errorMessage;
	public		$vaild = true;
	public		$scene = 'default';

	protected function setName($name){
		$this->_name = $name;
		return $this;
	}
	
	protected function getName(){
		return $this->_name;
	}
	
	abstract function toArray();
	public function vaild(){
		return true;	
	}
	
	protected function setErrorMessage($error,$message){
		if ($this->vaild){
			$this->vaild = false;
		}
		$this->_errorMessage[$error] = $message;
		return $this;
	}
		
	public function errorMessage($error = null){
		$return = false;
		if (!empty($error)){
			$return = $this->_errorMessage[$error];
		}else{
			$return = $this->_errorMessage;
		}
		return $return;
	}
	
	protected function getClass(){
		return get_class($this);
	}
	
	protected function getScene(){
		return $this->scene;
	}
}